#ifndef __TIMER_H__
#define __TIMER_H__

#include "p18f2550.h"
#include "GenericTypeDefs.h"
#include "HardwareProfile.h"

// Clocks in MHz
#define CLK_PLL             96.0
#define CLK_SYS             (CLK_PLL / 2.0)
#define CLK_TIMER           (CLK_SYS / 4.0)
#define TIMER_PRESCALE      4.0

#define TIMER_IT_CYCLE      1000.0    /* us */
// IT is generated at 0xFFFF - 0x0000 transition
#define TIMER_RELOAD_VALUE    (UINT16)(0x10000L - (TIMER_IT_CYCLE * (CLK_TIMER / TIMER_PRESCALE)) )


// Public function prototypes
void initTimer0(void); 
void startTimer0(void);
void stopTimer0(void);
void timer0ISR(void);

extern UINT8 G_ucCondInput;
extern UINT16 G_uiaButtonHoldTime[8];
extern UINT16 G_uiKeepAliveTimer;



#endif //__TIMER_H__    
